<!DOCTYPE html>
<html>
    <head>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<title>添加</title>
	<meta name="keywords" content="">
	<meta name="description" content="">
	<link rel="shortcut icon" href="../favicon.ico">
	<link href="__PUBLIC__/css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
	<link href="__PUBLIC__/css/font-awesome.css?v=4.4.0" rel="stylesheet">
	<link href="__PUBLIC__/css/plugins/iCheck/custom.css" rel="stylesheet">
	<link href="__PUBLIC__/css/animate.css" rel="stylesheet">
	<link href="__PUBLIC__/css/style.css?v=4.1.0" rel="stylesheet">
	<link rel="stylesheet" href="__PUBLIC__/css/liandong.css"/>
	<link href="__PUBLIC__/Widget/webuploader/0.1.5/webuploader.css" rel="stylesheet" type="text/css" />
	<script src="__PUBLIC__/js/plugins/layer/laydate/laydate.js"></script>
	<style>
	    .img{ width: auto !important; max-width: 128px; max-height: 128px; }
	    .img_default{ width: auto !important; max-width: 128px; max-height: 128px; }
	</style>
    </head>
    <body class="gray-bg">
	<div class="wrapper wrapper-content animated fadeInRight">
	    <div class="row">
		<div class="col-sm-12">
		    <div class="ibox float-e-margins">
			<div class="ibox-title">
			    <h5>添加- <small><{$columnname}></small>
			    </h5>
			</div>
			<div class="ibox-content">
			    <form method="post" class="form-horizontal" onsubmit="return false">
				<if condition="$id gt 0">
				    <div class="form-group">
					<label class="col-sm-2 control-label">编号</label>
					<div class="col-sm-10 control-label" style="text-align: left;">
					    <{$id}>
					</div>
				    </div>
				</if>
				<div class="form-group">
					<label class="col-sm-2 control-label">*星级</label>
					<div class="col-sm-10">
						<input type="text" class="form-control  int" value="<{$data.name}>" placeholder="请输入名称" id="txtname">
					</div>

				</div>
                                
                                <div class="form-group">
					<label class="col-sm-2 control-label">*直播分成</label>
					<div class="col-sm-10">
						<input type="text" class="form-control  int" value="<{$data.live_rate}>" placeholder="请输入数字" id="txtname1">
					</div>

				</div>
                                
                                <div class="form-group">
					<label class="col-sm-2 control-label">*礼物分成</label>
					<div class="col-sm-10">
						<input type="text" class="form-control  int" value="<{$data.gift_rate}>" placeholder="请输入数字" id="txtname2">
					</div>

				</div>
                                
                                <div class="form-group">
					<label class="col-sm-2 control-label">*真心话分成</label>
					<div class="col-sm-10">
						<input type="text" class="form-control  int" value="<{$data.question_rate}>" placeholder="请输入数字" id="txtname3">
					</div>

				</div>
                                <div class="form-group">
					<label class="col-sm-2 control-label">*累计金额</label>
					<div class="col-sm-10">
						<input type="text" class="form-control int" value="<{$data.money}>" placeholder="请输入数字" id="txtname4">
					</div>

				</div>
                                <div class="form-group">
					<label class="col-sm-2 control-label">*累计真心话</label>
					<div class="col-sm-10">
						<input type="text" class="form-control  int" value="<{$data.question_num}>" placeholder="请输入数字" id="txtname5">
					</div>

				</div>

				<div class="hr-line-dashed"></div>
				<div class="form-group">
				    <div class="col-sm-4 col-sm-offset-2">
					<button class="btn btn-primary" type="button" onclick="add_submit(this)"><{$btnname}></button>&nbsp;&nbsp;&nbsp;
					<button class="btn btn-white" type="reset">重置</button>
				    </div>
				</div>
			    </form>

			</div>
		    </div>
		</div>
	    </div>
	</div>
	<!--  全局js -->
	<script src="__PUBLIC__/js/jquery.min.js?v=2.1.4"></script>
	<script src="__PUBLIC__/js/bootstrap.min.js?v=3.3.6"></script>
	<!-- 自定义js -->
	<script src="__PUBLIC__/js/content.js?v=1.0.0"></script>
	<script src="__PUBLIC__/js/plugins/layer/layer.min.js"></script>
	<script src="__PUBLIC__/js/liandong.js"></script> 
	<script src="__PUBLIC__/js/ajaxfileupload.js"></script>
	<script src="__PUBLIC__/Widget/webuploader/0.1.5/webuploader.min.js"></script>
	<!--这里加载的语言文件会覆盖你在配置项目里添加的语言类型，比如你在配置项目里配置的是英文，这里加载的中文，那最后就是中文-->
	<script>
					    var taskadd = "<{:U('add','','shtml')}>";
					    var tasklist = "<{:U('index','','shtml')}>";
					    function check_int(val) {
					        return /^[0-9]*$/.test(val);
					    }


					    function add_submit(obj) {

							var $obj = $(obj);

							var id = "<{$id}>";

							var title = $('#txtname').val();
							

							if (title == "") {
								layer.alert('名称不能为空！\r\n', {title: '提示框', icon: 0});
								return false;
							}

							$.post(taskadd, {id: id, name: title, live_rate: $('#txtname').val(),
                                                                    
                                                                gift_rate: $('#txtname1').val(),
                                                            question_rate: $('#txtname2').val(),
                                                        live_rate: $('#txtname3').val(),
                                                         money :$('#txtname4').val(),
                                                          question_num :$('#txtname5').val(),
                                                    
        
        },
								function (data) {
									if (data.ret == '1001') {
									layer.msg(data.code, {icon: 6, time: 1000});
									setTimeout(function () {
										window.location.href = tasklist;
									}, 1000);
									} else {
									layer.msg(data.code, {icon: 5, time: 1000});
									$obj.html(labname).addClass('btn-primary').attr('onclick', 'gift_add_submit(this)');
									}
								}, 'json');
							}


	</script>
    </body>
</html>
